<?php 

require_once('functions.php');

$var_input_id = $var_input;
	if (stristr($var_input_id,"765611")) {
		$var_output_id = $var_input_id;
		$var_profile_type = "profiles";
	} elseif (stristr($var_input_id,"STEAM_0")) {
		$var_output_id = GetFriendId($var_input_id);
		$var_profile_type = "profiles";
	} else{
		$var_output_id = $var_input_id;
		$var_profile_type = "id";
	}

	
$data = file_get_contents("http://steamcommunity.com/{$var_profile_type}/{$var_output_id}/?xml=1");
//$data = simplexml_load_file("http://www.steamcommunity.com/{$var_profile_type}/{$var_output_id}/?xml=1", 'SimpleXMLElement', LIBXML_NOCDATA);
//$data = simplexml_load_file("http://www.steamcommunity.com/{$var_profile_type}/{$var_output_id}/?xml=1");
if (!empty($data)) { $data = preg_replace('/[^(\x20-\x7F)]*/', '', $data); }
if (!empty($data)) { $xml = simplexml_load_string($data); }
//if (!empty($data)) { $xml = $data; }

$steamarray = array(
   'community_id'      => $xml->steamID64,
   'name'              => $xml->steamID,
   'status'            => $xml->onlineState,
   'action'            => $xml->stateMessage,
   'privacy'           => $xml->privacyState,
   'visibility'        => $xml->visibilityState,
   'avatar_icon'       => $xml->avatarIcon,
   'avatar_medium'     => $xml->avatarMedium,
   'avatar_full'       => $xml->avatarFull,
   'vac_banned'        => $xml->vacBanned,
   'custom_url'        => $xml->customURL,
   'registration_date' => $xml->memberSince,
   'rating'            => $xml->steamRating,
   'hours_played'      => $xml->hoursPlayed2Wk,
   'headline'          => $xml->headline,
   'location'          => $xml->location,
   'real_name'         => $xml->realname,
   'summary'           => $xml->summary,
 );


?>
